const Router = require('koa-router');
const {auth, btnAuth} = require('../middleware/auth.middleware');
const {
    getBikeList,
    addBike,
    updateBike,
    deleteBike,
    getBikeDetail,
    updateBikeStatus
} = require('../controller/bikeController')
const {bikeValidator} = require('../middleware/bike.middleware')

const bikeRouter = new Router({prefix: '/bike'});

bikeRouter.get('/list', auth, getBikeList);

bikeRouter.post('/add', auth, bikeValidator, addBike);

bikeRouter.put('/update/:id', auth, bikeValidator, updateBike);

bikeRouter.delete('/delete/:id', auth, deleteBike);

bikeRouter.get('/getDetail/:id', auth, getBikeDetail);

//修改单车状态
bikeRouter.put('/updateStatus/:id', auth, updateBikeStatus)

module.exports = bikeRouter;
